@charset "UTF-8";
@import "./themse";

.sideNav-wrap {
    height: 100%;
    display: inline-flex;
    flex-direction: column;
    user-select: none;
    box-shadow: 2px 0 6px rgba(0, 0, 0, .05);
    position: relative;
    z-index: 10;
}
//最外层导航盒子
.sideNav {
    position: relative;
    z-index: 999;
    font-size: 14px;
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: none;
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(180, 188, 204, 0.4);
    }

    width:240px;
    height: 100%;
    transition: width .2s cubic-bezier(.645, .045, .355, 1),
    padding .2s cubic-bezier(.645, .045, .355, 1);
    display: inline-flex;
    flex-direction: column;
    user-select: none;


    .sideNav-head {
        box-sizing: border-box;
        padding: 24px;
        height: 64px;
        display: flex;
        align-items: center;
        cursor: pointer;
        transition: width .2s cubic-bezier(.645, .045, .355, 1), padding .2s cubic-bezier(.645, .045, .355, 1);

        .logo {
            width: 32px;
            margin-right: 5px;
            img{
                width: 32px;
            }
        }

        .title {
            flex: 1;
            transition: width .2s cubic-bezier(.645, .045, .355, 1);
            font-size: 24px;
            font-weight: bold;
            white-space: nowrap;
            overflow: hidden;
        }
    }

    .sideNav-body {
        flex: 1;
        max-height: calc(100% - 64px - 46px);
        overflow: auto;

        .sm-title {
            display: none;
        }

        .content-box {
            padding: 0 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            position: relative;
            transition: width .2s cubic-bezier(.645, .045, .355, 1), padding .2s cubic-bezier(.645, .045, .355, 1);

            .ico-item {
                width: 24px;

                i {
                    width: 24px;
                    text-align: center;
                    vertical-align: -2px;
                }
            }

            .text {
                flex: 1;
                transition: opacity .2s cubic-bezier(.645, .045, .355, 1), color .1s;
                overflow: hidden;
                white-space: nowrap;
                padding-left: 6px;
                opacity: 1;
            }

        }

        .sideNav-item-1 {
            line-height: 48px;
            font-size: 16px;
            height: 48px;
            overflow: hidden;
            transition: height .2s cubic-bezier(.645, .045, .355, 1);
        }

        .sideNav-item-2 {
            line-height: 40px;
            font-size: 14px;
            height: 40px;
            overflow: hidden;
            transition: height .2s cubic-bezier(.645, .045, .355, 1);

            >.content-box {
                padding-left: 48px;
            }
        }

        .sideNav-item-3 {
            transition: height .2s cubic-bezier(.645, .045, .355, 1);

            >.content-box {
                padding-left: 72px;
            }
        }

        .sideNav-wrap-2 {
            opacity: 0;
            transition: all .2s cubic-bezier(.645, .045, .355, 1);
        }

        .sideNav-wrap-3 {
            opacity: 0;
            transition: all .2s cubic-bezier(.645, .045, .355, 1);
        }

        .open {
            height: auto;

            .sideNav-wrap-2 {
                opacity: 1;
            }

            .sideNav-wrap-3 {
                opacity: 1;
            }
        }
    }

    .sideNav-foot {
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        height: 48px;
        cursor: pointer;
        position: relative;
        z-index: 2;
        .switch-size {
            box-sizing: border-box;
            height: 100%;
            padding: 14px 24px;
            transition: all .2s cubic-bezier(.645, .045, .355, 1);
        }

        .ico {
            font-size: 18px;
        }
    }

    .sideNav-extend {
        display: flex;
        flex-wrap: wrap;

        .userBox {
            width: 100%;
            min-width: 100%;
            padding: 12px;

            .userName {
                overflow: hidden;
                white-space: nowrap;
            }
        }
    }

    .open {
        >.content-box {
            .chevron {
                &::before {
                    transform: rotate(45deg) translateX(2px);
                }

                &:after {
                    transform: rotate(-45deg) translateX(-2px);
                }
            }
        }
    }

    .sideNav-child-wrap {
        display: none;
    }

    //=====================选中状态
    .active {
        >.content-box {
            position: relative;

            &::before {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                width: 3px;
                height: 100%;
            }
        }
    }

    //皮肤定义(大侧板栏)
    @include themify($themes) {
        background: themed('background-color');
        color: themed('font-color');

        //=====================所有子项
        .content-box {
            &:hover {
                background: themed('hover-bg');
                color: themed('hover-ft');

                .chevron {

                    &::before,
                    &:after {
                        background: themed('hover-ft');
                    }
                }
            }
        }

        //=====================选中状态颜色
        .active {
            >.content-box {
                background: themed('active-bg');
                color: themed('active-ft');

                &::before {
                    background: themed('active-bol');
                }

                &:hover {
                    background: themed('active-bg');
                    color: themed('active-ft');

                    &::before {
                        background: themed('active-bol');
                    }
                }
            }
        }

        //有子集选中时,被选中转态
        .actived:not(.open) {
            >.content-box {
                color: themed('active-ft');
                background: themed('active-bg');

                &::before {
                    content: "";
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 3px;
                    height: 100%;
                    background: themed("active-bol");
                }

                &:hover {
                    color: themed('active-ft');
                    background: themed('active-bg');
                }

                .chevron {
                    &::before,
                    &:after {
                        background: themed('active-ft');
                    }
                }
            }
        }

        //打开状态
        .open {
            >.content-box {
                color: themed('hover-ft');

                .chevron {

                    &::before,
                    &:after {
                        background: themed('open-bg');
                    }
                }
            }
        }

        //展开箭头主题色
        .chevron {
            &::before {
                background: themed('font-color');
            }

            &:after {
                background: themed('font-color');
            }
        }

        .sideNav-head {
            .title {
                color: themed('title-color');
            }
        }

        .sideNav-body {

            .sideNav-item-2 {
                background: themed('bg2-color');
            }

            .sideNav-item-3 {
                background: themed('bg2-color');
            }


        }

        .sideNav-foot {
            &:hover {
                .ico {
                    color: themed('hover-ft');
                }
            }
        }
    }
}

//最外层导航盒子(小)
.sideNav[nav-sm] {
    width: 56px;

    .open {
        overflow: hidden;
    }

    .sideNav-head {
        padding: 0 16px;

        .title {
            width: 0;
            max-width: 23px;
        }
    }

    .sideNav-body {
        .no-child {
            &:after {
                display: none !important;
            }

            .sm-title {
                border-radius: 0 6px 6px 0;
            }
        }

        .sideNav-item-1 {
            position: relative;

            >.content-box {
                padding: 0 16px;
                height: 48px;

                .text {
                    opacity: 0;
                }

                .chevron {
                    opacity: 0;
                }
            }
        }

        .sideNav-wrap-2 {
            display: none;
        }
    }

    .sideNav-foot {
        .switch-size {
            height: 100%;
            padding: 14px 18px;
        }
    }

    .sideNav-extend {
        flex-wrap: wrap;

        .userBox {
            width: 100%;
            min-width: 100%;
            padding: 12px;

            .userName {
                width: 0;
            }
        }
    }

    .sideNav-child-wrap {
        display: block;
    }


}

//导航二级菜单(小)
.sideNav-child-wrap {
    display: inline-block;
    width: 220px;

    .chevron {
        transform: translateY(3px) rotate(-90deg);
    }

    .open {
        >.content-box {
            .chevron {
                &::before {
                    transform: rotate(-45deg) translateX(2px);
                }

                &:after {
                    transform: rotate(45deg) translateX(-2px);
                }
            }
        }
    }

    .sm-title {
        display: block;
        padding: 0 24px;
        font-size: 16px;
        line-height: 48px;
        border-radius: 0 6px 0 0;
    }

    .content-box {
        line-height: 40px;
        padding: 0 24px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        transition: width .2s cubic-bezier(.645, .045, .355, 1), padding .2s cubic-bezier(.645, .045, .355, 1);

        .ico-item {
            width: 24px;

            i {
                width: 24px;
                text-align: center;
                vertical-align: -2px;
            }
        }

        .text {
            flex: 1;
            transition: opacity .2s cubic-bezier(.645, .045, .355, 1), color .1s;
            overflow: hidden;
            white-space: nowrap;
            padding-left: 8px;
            opacity: 1;
        }

    }

    .sideNav-child {
        position: absolute;
        top: 0;
        width: 220px;
        opacity: 0;
        transition: all .2s cubic-bezier(.645, .045, .355, 1);
        transform: scale(0.6) translate3d(0, 0, 0);
        transform-origin: 0 0 0;
        pointer-events: none;

        &:after {
            pointer-events: none;
            content: "";
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            box-shadow: 2px 0 6px rgba(0, 0, 0, .05);
        }

        &.fadeIn {
            pointer-events: visible;
            opacity: 1;
            transform: scale(1) translate3d(0, 0, 0);
        }
    }

    .sideNav-child2 {
        position: relative;

        &.open {
            overflow: unset;

            .sideNav-wrap-3 {
                pointer-events: visible;
                opacity: 1;
                transform: scale(1) translate3d(0, 0, 0);
            }
        }
    }

    .sideNav-wrap-3 {
        opacity: 0;
        transition: all .2s cubic-bezier(.645, .045, .355, 1);
        transform: scale(0.6) translate3d(0, 0, 0);
        transform-origin: 0 0 0;
        pointer-events: none;
        position: absolute;
        top: 0;
        left: 220px;
        width: 220px;
        background: #fff;
        box-shadow: 2px 0 6px rgba(0, 0, 0, .05);
    }
}

//最外层导航盒子(顶部)
.sideNav[nav-top] {
    width: 100%;
    height: 64px;
    box-shadow: 2px 0 6px rgba(0, 0, 0, .05);

    .sideNav-wrap {
        display: flex;
        flex-direction: row;
    }

    .sideNav-body {
        height: 64px;
        max-height: 64px;
        display: flex;
        overflow: hidden;

        .sideNav-item-1 {
            display: block;
            height: 64px;
            line-height: 64px;
            flex-shrink: 0;

            .sideNav-wrap-2 {
                display: none;
            }

            .chevron {
                display: none;
            }
        }
    }

    .sideNav-foot {
        height: 64px;
    }

    .sideNav-extend {
        padding: 0 24px;

        .userBox {
            width: auto;
            min-width: auto;
        }
    }

    .sideNav-child-wrap {
        display: block;
    }

    .sm-title {
        display: none;
    }

    .sideNav-child-wrap {
        .sideNav-child {
            width: 200px;
        }

        .sideNav-wrap-3 {
            left: 200px;
        }

        .content-box {
            line-height: 48px;
        }
    }
}

//更多菜单(顶部导航)
.sideMore {
    position: relative;
    display: none;

    .sideMore-text {
        line-height: 64px;
        padding: 0 24px;
        font-size: 24px;
        cursor: pointer;
        transition: all .2s cubic-bezier(.645, .045, .355, 1);

        i {
            display: block;
            transform: translateY(-6px);
        }
    }

    .sideMore-wrap {
        opacity: 0;
        pointer-events: none;
        transform: scale(.6) translate3d(0, 0, 0);
        transform-origin: 100% 0;
        transition: all .2s cubic-bezier(0.645, 0.045, 0.355, 1);
        position: absolute;
        top: 64px;
        right: 0;
        width: 200px;

        .sideNav-item-1 {
            line-height: 48px;
            display: flex;
            position: relative;
            &.open {
                .sideNav-wrap-2 {
                    pointer-events: visible;
                    opacity: 1;
                    transform: scale(1) translate3d(0, 0, 0);
                }
            }

        }

        .sideNav-wrap-2 {
            opacity: 0;
            pointer-events: none;
            transform: scale(.6) translate3d(0, 0, 0);
            transform-origin: 100% 0;
            transition: all .2s cubic-bezier(0.645, 0.045, 0.355, 1);
            position: absolute;
            top: 0;
            right: 200px;
            width: 200px;

            .sideNav-item-2 {
                position: relative;

                &.open {
                    .sideNav-wrap-3 {
                        pointer-events: visible;
                        opacity: 1;
                        transform: scale(1) translate3d(0, 0, 0);
                    }
                }
            }

        }

        .sideNav-wrap-3 {
            opacity: 0;
            pointer-events: none;
            transform: scale(.6) translate3d(0, 0, 0);
            transform-origin: 100% 0;
            transition: all .2s cubic-bezier(0.645, 0.045, 0.355, 1);
            position: absolute;
            top: 0;
            right: 200px;
            width: 200px;
        }

        .content-box {
            width: 100%;
            padding: 0 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            position: relative;
            transition: width .2s cubic-bezier(0.645, 0.045, 0.355, 1), padding .2s cubic-bezier(0.645, 0.045, 0.355, 1);

            .ico-item {
                width: 24px;

                i {
                    width: 24px;
                    text-align: center;
                    vertical-align: -2px;
                }
            }

            .text {
                flex: 1;
                transition: opacity .2s cubic-bezier(.645, .045, .355, 1), color .1s;
                overflow: hidden;
                white-space: nowrap;
                padding-left: 8px;
                opacity: 1;
            }
        }


    }

    &.open {
        .sideMore-wrap {
            pointer-events: visible;
            opacity: 1;
            transform: scale(1) translate3d(0, 0, 0);
        }
    }

}

.sideNav[nav-top] {
    .sideNav-item-1 {
        .content-box {
            &::before {
                display: none!important;
            }
        }
        &.active,&.actived  {
            position: relative;
            &::before{
                content: "";
                position: absolute;
                width: 100%;
                height: 3px;
                top: 0;
                left: 0;
                z-index: 9;
            }
        }
    }
    @include themify($themes) {
        .sideNav-item-1 {
            &.active,&.actived {
                &::before{
                    background: themed("active-bol");
                }
            }
        }
        .sideMore {
            &.open {
                .sideMore-text {
                    color: themed('hover-ft');
                    background: themed('hover-bg');
                }
            }

            .sideNav-item-1 {
                &.open {
                    >.content-box {
                        background: themed("sm-hover-bg");
                        color: themed("sm-hover-ft");
                    }
                }
            }

            .sideMore-text {
                &:hover {
                    color: themed('hover-ft');
                    background: themed('hover-bg');
                }
            }

            &.actived:not(.open) {
                .sideMore-text {
                    color: themed('active-ft');
                    background: themed('active-bg');
                }
            }

            .sideMore-wrap {
                background: themed('sm-bg');
                color: themed('sm-ft');

                .sideNav-wrap-2 {
                    background: themed('sm-bg');
                    color: themed('sm-ft');
                }

                .sideNav-wrap-3 {
                    background: themed('sm-bg');
                    color: themed('sm-ft');
                }
            }
        }
    }
}


.sideNav[nav-sm],
.sideNav[nav-top] {

    //皮肤定义(小)
    @include themify($themes) {
        .chevron {
            &::before,
            &::after {
                background: themed('sm-ft');
            }
        }
        .sideNav-body {
            .sideNav-item-1 {
                &.actived:not(.open) {
                    >.content-box {
                        background: themed('active-bg');

                        &::before {
                            display: block;
                        }
                    }
                }

                &.active {
                    >.content-box {
                        background: themed('active-bg');
                        color: themed('active-ft');
                    }
                }
            }
        }

        //=====================所有子项
        .content-box {
            &:hover {
                background: themed('sm-hover-bg');
                color: themed('sm-hover-ft');

                .chevron {

                    &::before,
                    &:after {
                        background: themed('sm-hover-ft');
                    }
                }
            }
        }

        .sideNav-item-1 {
            >.content-box {
                &:hover {
                    background: themed('hover-bg');
                    color: themed('hover-ft');
                }
            }
        }


        //=====================选中状态颜色
        .active {
            >.content-box {
                background: themed('sm-active-bg');
                color: themed('sm-active-ft');

                &::before {
                    background: themed('active-bol');
                }

                &:hover {
                    background: themed('sm-active-bg');
                    color: themed('sm-active-ft');

                    &::before {
                        background: themed('active-bol');
                    }
                }
            }
        }

        .actived:not(.open) {
            >.content-box {
                background: themed("sm-active-bg");
                color: themed("sm-active-ft");

                &::before {
                    display: none;
                }

                &:hover {
                    background: themed("sm-active-bg");
                    color: themed("sm-active-ft");
                }
            }
        }

        .open {
            >.content-box {
                background: themed('sm-hover-bg');
                color: themed('sm-hover-ft');

                .chevron {

                    &::before,
                    &::after {
                        background: themed('sm-hover-ft');
                    }
                }
            }
        }

        //一级菜单单独配色
        .sideNav-item-1 {
            &.open {
                >.content-box {
                    background: themed('hover-bg');
                    color: themed('hover-ft');
                }
            }
        }

        //二,s级菜单单独配色
        .sideNav-child2,
        .sideNav-child3 {
            &.active {
                >.content-box {
                    &::before {
                        background: themed('sm-active-bg');
                    }
                }
            }
        }

        .sideNav-child-wrap {
            .sideNav-child {
                background: themed('sm-bg');
                color: themed('sm-ft');
            }

            .chevron {

                &::before,
                &::after {
                    background: themed('sm-ft');
                }
            }

            .sm-title {
                background: themed('sm-bg');
            }

            .sideNav-wrap-2 {
                color: themed('sm-ft');

                &::after {
                    background: themed('sm-bg');
                }
            }

            .sideNav-item-2,
            .sideNav-item-3,
            .sideNav-child3 {
                background: themed('sm-bg');
            }
        }
    }
}

//展开箭头
.chevron {
    position: relative;
    transition: all .2s cubic-bezier(.645, .045, .355, 1);

    &::before {
        position: absolute;
        width: 6px;
        height: 1.5px;
        background-image: linear-gradient(90deg, rgba(0, 0, 0, .65), rgba(0, 0, 0, .65));
        border-radius: 2px;
        transition: background .2s cubic-bezier(.645, .045, .355, 1), transform .2s cubic-bezier(.645, .045, .355, 1), top .2s cubic-bezier(.645, .045, .355, 1);
        content: "";
        transform: rotate(-45deg) translateX(2px);
    }

    &:after {
        position: absolute;
        width: 6px;
        height: 1.5px;
        background-image: linear-gradient(90deg, rgba(0, 0, 0, .65), rgba(0, 0, 0, .65));
        border-radius: 2px;
        transition: background .2s cubic-bezier(.645, .045, .355, 1), transform .2s cubic-bezier(.645, .045, .355, 1), top .2s cubic-bezier(.645, .045, .355, 1);
        content: "";
        transform: rotate(45deg) translateX(-2px);
    }
}

//过渡时动画
.transformtime {
    .sideNav-wrap-2 {
        display: none;
    }

    .sideNav-wrap-3 {
        display: none;
    }
}